import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
declare module 'vue-router' {
  interface RouteMeta {
    icon?: string
  }
}

const menuRoutes: RouteRecordRaw[] = [
  //   {
  //     path: '/tree',
  //     name: '树控件',
  //     component: () => import('@/views/RouteView.vue'),
  //     meta: { icon: 'check-circle' },
  //     children: [
  //       {
  //         path: '/treeselect',
  //         name: '筛选树',
  //         component: () => import('@/views/TreeSelect/index.vue'),
  //       },
  //     ],
  //   },
  //   {
  //     path: '/table',
  //     name: '表格',
  //     component: () => import('@/views/RouteView.vue'),
  //     meta: { icon: 'check-circle' },
  //     children: [
  //       {
  //         path: '/table/index',
  //         name: '基础表格',
  //         component: () => import('@/views/Tables/index.vue'),
  //       },
  //     ],
  //   },
  {
    path: '/home',
    name: 'One,',
    component: () => import('@/components/HelloWorld.vue'),
    children: [
      {
        path: '/one/two',
        name: 'one/two',
        component: () => import('@/components/HelloWorld.vue'),
        meta: { icon: 'check-circle' },
        children: [
          {
            path: '/one/two/3',
            name: 'one/two/3',
            component: () => import('@/components/HelloWorld.vue'),
            meta: { icon: 'check-circle' },
          },
        ],
      },
      {
        path: '/one/three',
        name: 'one/three',
        component: () => import('@/components/HelloWorld.vue'),
        meta: { icon: 'check-circle' },
      },
    ],
    meta: { icon: 'check-circle' },
  },
  {
    path: '/two',
    name: 'Two',
    component: () => import('@/components/HelloWorld.vue'),
    children: [
      {
        path: '/two/two',
        name: 'two/two',
        component: () => import('@/components/HelloWorld.vue'),
        meta: { icon: 'check-circle' },
      },
    ],
    meta: { icon: 'check-circle' },
  },
]
const routes: RouteRecordRaw[] = [
  { path: '/', redirect: '/home' },
  {
    path: '/',
    component: () => import('@/views/RouteView.vue'),
    children: menuRoutes,
  },
]
const router = createRouter({
  history: createWebHistory(),
  routes,
})
export default router
export { routes, menuRoutes }
